{% load comments %}
{% load set_var %}

{% get_comment_count for photoContent as comment_count %}
{% get_comment_list for photoContent as comment_list %}

{% for comment in comment_list %}
	<div class="commentaire{% if forloop.counter > 2 and displayAll == 0 %}Hide{% endif %}">
		<img class="avatar" src="/media/images/avatar.png" style="" />
		<div class="CommentTextBlock">
			<span class="date">({{comment.submit_date}})</span>
			<span style="font-size:15px;font-weight:bold;">{{comment.user}}</span><br />
			{{comment.comment}}<br />
			<div style="clear:both;"></div>
		</div>
	</div>
{% endfor %}

{% if comment_count == 0 %}
<div class="commentaire" style="text-align:center; min-height:15px !important;">
	Aucun commentaire pour cette photo.
</div>
{% endif %}

{% if comment_count > 2 and displayAll == 0 %}
<div class="barreMoreComm" rel="{{photoContent.id}}">
	{% set nbCommToDisplay = comment_count - 2 %}
	+ Afficher tous les commentaires (+{{nbCommToDisplay}})
</div>
{% endif %}

<div style="clear:both;"></div>

	
<script type="text/javascript">
$(function() {
	$("#nbComments{{photoContent.id}}").html("{{comment_count}}");
	
});	


</script>